﻿using System;

namespace mojoPortal.Web.RS.Controls
{
    public partial class ModalActionMessageControl : RSBaseUserControl
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            
        }

        public void ShowModal(string message, string returnurl, bool issucess = true)
        {
            if(issucess)
                lblActionMessage.ForeColor = System.Drawing.Color.DarkBlue;
            else
                lblActionMessage.ForeColor = System.Drawing.Color.Maroon;

            lblActionMessage.Text = message;
            hfReturnURL.Value = returnurl;
            mpeModalActionMessageResult.Show();
        }

        protected void btnModalOK_Click(Object sender, EventArgs e)
        {
            if (hfReturnURL.Value.Length > 0)
                Response.Redirect(hfReturnURL.Value);
            else
                mpeModalActionMessageResult.Hide();
        }
    }
}